package com.example.mskefu.controller;

import com.example.mskefu.entity.dto.BrowseRecordAndShop;
import com.example.mskefu.mapper.BrowseRecordAndShopMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;

@RestController
public class BrowseRecordAndShopController {
    @Autowired
    private BrowseRecordAndShopMapper browseRecordAndShopMapper;

    @GetMapping("/KeFu/{userId}")
    public ArrayList<BrowseRecordAndShop> getBrowseRecoedAndShopByUserId(@PathVariable("userId") String userId) {
        return browseRecordAndShopMapper.getBrowseRecoedAndShopByUserId(userId);
    }

    @GetMapping("/KeFu/byShopId/{shopId}")
    public ArrayList<BrowseRecordAndShop> getBrowseRecoedAndShopByShopId(@PathVariable("shopId") String shopId) {
        return browseRecordAndShopMapper.getBrowseRecoedAndShopByShopId(shopId);
    }

}
